﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="AssetItemList.aspx.cs"
    Inherits="MTRC.ODMS.Web.SOM.CodeSetup.AssetItemList" %>

<%@ Register Assembly="APJ.Web.UI.WebControls" Namespace="APJ.Web.UI.WebControls"
    TagPrefix="APJ" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControlToolkit" %>
<%@ Register Src="~/UserControl/Menu/PageFoot.ascx" TagName="PageFoot" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/TabStrip.ascx" TagName="TabStrip" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/PageHead.ascx" TagName="PageHead" TagPrefix="WebStructure" %>
<%@ Register Src="~/UserControl/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="WebStructure" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Operational Data Management System</title>
    <link href="<%=ResolveUrl("~/CSS/common.css")%>" rel="stylesheet" type="text/css" />
    <link href="../../css/odms.css" type="text/css" rel="stylesheet" />

    <!--Comment by jack 20151030 for u274-->
    <link href="<%=ResolveUrl("~/JqueryUICombox/jquery-ui.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%=ResolveUrl("~/jQuery/jquery-1.6.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=ResolveUrl("~/JqueryUICombox/jquery-ui.js")%>" type="text/javascript"></script>
    <!--Comment by jack 20151117 for u274-->
    <script src="<%=ResolveUrl("~/JqueryUICombox/combox_noclearandparturesearch.js")%>" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(function () {
            InitCombobox();
        });
        function InitCombobox() {
            $(".combobox").combobox();

            $("#toggle").click(function () {
                $(".combobox").toggle();
            });

            $(".custom-combobox").css({ "height": "20px" });
            //$(".ui-widget").css({ "width": "80%", "margin-right": "1%" });
            $(".ui-widget").css({ "width": "190px", "margin-right": "1%" });
            $(".custom-combobox input").css({ "width": "170px", "height": "18px", "line-height": "18px" });
            $(".custom-combobox a").css({ "width": "16px", "height": "20px", "position": "relative", "top": "-4px", "left": "-2px" });
            $(".ui-autocomplete").css({ "max-height": (document.body.clientHeight - 390) + "px" });

            /*Comment by jack 20151117 for u274*/
            if ($("#txtSelectedAssetType").val()!="")
            {
                $(".custom-combobox input").val($("#txtSelectedAssetType").val());
            }
            $(".custom-combobox input").change(function () {
                $("#txtSelectedAssetType").val($(".custom-combobox input").val());
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <AjaxControlToolkit:ToolkitScriptManager ID="ToolkitScriptManager" runat="server">
        </AjaxControlToolkit:ToolkitScriptManager>
        <table border="0" cellpadding="0" cellspacing="0" class="Page_Container">
            <tr>
                <td colspan="2" class="Page_Head">
                    <WebStructure:PageHead ID="PageHead" runat="server" />
                </td>
            </tr>
            <tr>
                <td class="Page_Left">
                    <WebStructure:MainMenu ID="MainMenu" runat="server" AppPath="../../" CurrMenuID="M140901" />
                </td>
                <td class="Page_Right">
                    <table class="Page_Contents">
                        <tr>
                            <td class="TabStrip">
                                <WebStructure:TabStrip ID="TabStrip" CurrMenuID="M140803" ParentMenuID="M140901" DMenuMode="CurrOnly"
                                    runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td class="Contents">
                                 <asp:UpdatePanel runat="server" ID="updatePanel1" UpdateMode="Conditional">
                                 <ContentTemplate>
                                 <div class="SearchArea" style="margin-bottom:5px;width:99.8%;">
                                    <table width="100%" border="0px">
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblStation" runat="server"></asp:Label>
                                                <asp:DropDownList ID="ddlStation" runat="server" CssClass="ddlStation"></asp:DropDownList>
                                                <asp:Label ID="lblAssetType" runat="server"></asp:Label>
                                                <%--<asp:TextBox ID="txtAssetType" runat="server"></asp:TextBox>--%>
                                                <asp:TextBox ID="txtAssetType" runat="server" Visible="false"></asp:TextBox>
                                                <span class="ui-widget" style="width:130px;">
                                                    <asp:DropDownList runat="server" ID="ddlAssetType"  CssClass="combobox"></asp:DropDownList>
                                                    <!--Comment by jack 20151117 for u274-->
                                                    <asp:HiddenField runat="server" ID="txtSelectedAssetType" ClientIDMode="Static" />
                                                </span>
                                                <asp:Button ID="btnClearAssetType" OnClick="btnClearAssetType_Click" runat="server"></asp:Button>
                                                <asp:Label ID="lblAssetItem" runat="server"></asp:Label>
                                                <asp:TextBox ID="txtAssetItem" runat="server"></asp:TextBox>
                                                <asp:Label ID="lblIncludeVoid" runat="server"></asp:Label>
                                                <asp:CheckBox ID="chkVoid" runat="server" />                                  
                                            </td>
                                            <td align="right">
                                                <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" />
                                                <asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                 </div>
                                
                                 <APJ:CommonGridView ID="grdAssetItemList" runat="server" AllowPaging="True" AllowSorting="True"
                                    AscPic="~/Images/Common/arrow_up_green.png" AutoGenerateColumns="False" BorderColor="black"
                                    CssClass="GridView" DescPic="~/Images/Common/arrow_down_green.png" OnNeedDataBind="grdAssetItemList_NeedDataBind"
                                    OnRowCommand="grdAssetItemList_RowCommand">
                                    <PagerSettings Position="Top" />
                                    <Columns>
                                        <asp:BoundField DataField="AssetItemID" HeaderText="AssetItemID" Visible="False" />
                                        <asp:BoundField DataField="StationDesc" HeaderText="SOM_Station"  SortExpression="StationDesc" />
                                        <asp:BoundField DataField="AssetTypeDesc" HeaderText="SOM_AssetType" SortExpression="AssetTypeDesc" />
                                        <asp:BoundField DataField="AssetTypeCode" HeaderText="SOM_AssetTypeCode" Visible="False" />
                                        <asp:BoundField DataField="AssetItemCode" HeaderText="SOM_AssetItem" SortExpression="AssetItemCode" />
                                        <asp:BoundField DataField="AssetItemDesc" HeaderText="COM_Description"  SortExpression="AssetItemDesc"  />
                                        <asp:CheckBoxField DataField="WithDetail" HeaderText="SOM_WithDetail" SortExpression="WithDetail" />
                                        <asp:BoundField DataField="StockQty" HeaderText="SOM_StockQty"  SortExpression="StockQty" />
                                        <%-- Comment by Gordon 20160216 ISU52 --%>
                                   <%--     <asp:BoundField DataField="AvailableQty" HeaderText="SOM_AvailableQty"  SortExpression="AvailableQty"  />--%>
                                        <asp:CheckBoxField DataField="FlagObsolete" HeaderText="SOM_Void" SortExpression="FlagObsolete" />
                                        <asp:TemplateField HeaderText="COM_Edit">
                                            <itemtemplate>
                                                <asp:ImageButton id="iBtnEdit"  ToolTip=<%# this.GetLabel("COM_Edit") %>  runat="server"  CssClass="link" CommandName="Edit" CommandArgument='<%# Eval("AssetItemID") %>' ImageUrl="../../Images/SOM/Edit.gif"></asp:ImageButton>                                                        
                                            </itemtemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerTemplate>
                                        <asp:Table ID="CommonPagerTemplate" runat="server" Width="100%">
                                            <asp:TableRow ID="LPOPT_TR" runat="server">
                                                <asp:TableCell ID="LPOPT_LCell" runat="server" HorizontalAlign="Left" Width="50%">
                                                    <asp:Label ID="Lbl_T_TotalRecords" runat="server">Total Records:</asp:Label>
                                                    <asp:Label ID="Lbl_V_TotalRecords" runat="server"></asp:Label>
                                                </asp:TableCell>
                                                <asp:TableCell ID="LPOPT_RCell" runat="server" HorizontalAlign="Right" Width="50%">
                                                    <asp:Label ID="Lbl_T_PageSize" runat="server">PageSize:</asp:Label>
                                                    &nbsp;&nbsp;<asp:DropDownList ID="DDL_PageSize" runat="server" AutoPostBack="True">
                                                        <asp:ListItem Value="5">5</asp:ListItem>
                                                        <asp:ListItem Value="10">10</asp:ListItem>
                                                        <asp:ListItem Value="15">15</asp:ListItem>
                                                        <asp:ListItem Value="20">20</asp:ListItem>
                                                        <asp:ListItem Value="25">25</asp:ListItem>
                                                        <asp:ListItem Value="30">30</asp:ListItem>
                                                    </asp:DropDownList>
                                                    &nbsp; &nbsp;
                                                    <asp:Label ID="Lbl_V_CurPage" runat="server"></asp:Label>
                                                    &nbsp;<asp:Label runat="server">/</asp:Label>
                                                    &nbsp;<asp:Label ID="Lbl_V_TotalPages" runat="server"></asp:Label>
                                                    &nbsp; &nbsp;
                                                    <asp:Label ID="Lbl_T_GoTo" runat="server">Go to:</asp:Label>
                                                    <asp:DropDownList ID="DDL_GoTo" runat="server" AutoPostBack="True">
                                                    </asp:DropDownList>
                                                    &nbsp; &nbsp;
                                                    <asp:LinkButton ID="LBtn_Previous" runat="server" CommandArgument="Prev" CommandName="Page"><</asp:LinkButton>
                                                    &nbsp;
                                                    <asp:LinkButton ID="LBtn_Next" runat="server" CommandArgument="Next" CommandName="Page">></asp:LinkButton>
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                    </PagerTemplate>
                                    <RowStyle CssClass="GridView_Row" />
                                    <HeaderStyle CssClass="GridView_Header" />
                                    <AlternatingRowStyle CssClass="GridView_AlternativeRow" />
                                </APJ:CommonGridView>
                                 </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                        </tr>
                        <tr>
                            <td class="Page_Foot" style="height: 54px">
                                <WebStructure:PageFoot ID="PageFoot" runat="server" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
